home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000061_icon-group-sender_Fri Mar 28 08:10:29 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SF8To16888
  4.     for icon-group-addresses; Fri, 28 Mar 2003 08:08:29 -0700 (MST)
  5. Message-Id: <200303281508.h2SF8To16888@baskerville.CS.Arizona.EDU>
  6. X-Sender: whm@mail.mse.com (Unverified)
  7. Date: Thu, 27 Mar 2003 22:10:08 -0700
  8. To: voice_of_reason@australia.edu (Quiet Voice)
  9. From: "William H. Mitchell" <whm86@mse.com>
  10. Subject: Re: newbie questions -- ressurected
  11. Cc: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. At 02:00 PM 3/27/03 -0800, Quiet Voice wrote:
  16. >
  17. >The correct code is as follows:
  18. >
  19. >every lettercount := !sort(lettercount,2) do
  20. >write(outputfile,lettercount[1]," -- ",lettercount[2])
  21. >
  22. >The one problem is that this sorts it in ascending order. Can't recall
  23. >if there is a direct function to sort decending...but that's a minor
  24. >concern right now.
  25.  
  26. There is no descending option for the built-in sort.  I usually use a
  27. down-counting to-by for that situation.  For example, instead of this:
  28.  
  29.    every x := !Sort(L) do
  30.  
  31. Do this:
  32.  
  33.    every x := Sort(L)[*L to 1 by -1] do
  34.       ...
  35.  
  36.